﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>审核人员增加列表</title>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	
	<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
	<link rel="stylesheet" href="lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
	<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
	<script type="text/javascript">
	
	function toTime(timestamp) {
   		var date = new Date(timestamp);
   			Y = date.getFullYear() + '-';
  			 M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
  			 D = date.getDate() + ' ';
  			 h = date.getHours() + ':';
   			m = (date.getMinutes() < 10 ? '0'+(date.getMinutes()) : date.getMinutes()) + ':';
 			  s = (date.getSeconds() < 10 ? '0'+(date.getSeconds()) : date.getSeconds());
 	  return Y+M+D+h+m+s;
	}
	//删除记录
	function del(id){
		if(confirm("你确定要删除这个申请记录吗？")){
			location="job/getbyid.action?n=2&id="+id;
		}
	}
		$(function(){
		//alert("xxx");
			$.getJSON("job/mylist.action","",function(res){
				//alert(res.length);
				for(var i=0;i<res.length;i++){
				//alert(i);
					var dep="";
					if(res[i].deptid!=null)dep=res[i].deptid.de_name;
					var time='';
					if(res[i].dealtime!=null)time=toTime(res[i].dealtime);
					var dealman="";
					if(res[i].dealempid.us_name!=null)dealman=res[i].dealempid.us_name;
					var newtr=$("<tr class='text-c va-m'></tr>");
					newtr.append("<td>"+res[i].id+"</td>");
					newtr.append("<td>"+dep+"</td>");
			 		newtr.append("<td>"+dealman+"</td>"); 
					newtr.append("<td>"+time+"</td>");
					newtr.append("<td>"+res[i].job_name+"</td>");
					newtr.append("<td>"+res[i].status+"</td>");
					if(res[i].status=='通过'){
						newtr.append("<td class='td-status'><a href='javascript:;' onclick=\"admin_add('详情','job/getbyid.action?id="+res[i].id+"&n=1','800','400')\"><span class='label label-success radius'>查看详情</span></a></td>");
					}else{
						newtr.append("<td class='td-status'><a href='javascript:;' onclick=\"admin_add('详情','job/getbyid.action?id="+res[i].id+"&n=1','800','400')\"><span class='label label-success radius'>查看详情</span></a>|<a href='javascript:del("+res[i].id+")'><span class='label label-success radius'>删除</span></a></td>");
					}
					
					$("tbody").append(newtr);
				}
			});
		});
	</script>
	<style type="text/css">
		
	</style>
</head>
<body class="pos-r">
<div>
	<div class="page-container">
		<div class="mt-20">
			<table class="table table-border table-bordered table-bg table-hover table-sort">
				<thead>
					<tr class="text-c">
						<th width="80">申请编号</th>
						<th width="100">部门名称</th>
						<th width="100">审核人</th>
						<th width="100">审核时间</th>
						<th width="100">工作名称</th>
						<th width="80">状态</th>
						<th width="150">操作</th>
					</tr>
				</thead>
				<tbody>
					
				</tbody>
			</table>
		</div>
	</div>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
/*管理员-编辑*/

function admin_add(title,url,w,h){
	layer_show(title,url,w,h);
}
</script>


</body>
</html>